<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: /home/herik/CPPWebFramework/CPPWebFramework/cwf/controller.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">C++ Web Framework
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b2448bd9c6b97c57da490a507d179d6c.html">CPPWebFramework</a></li><li class="navelem"><a class="el" href="dir_3bacee99d34edff13677baafd8c3a47f.html">cwf</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">controller.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> Distributed under MIT license, or public domain if desired and</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> recognized in your jurisdiction.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> See file LICENSE for detail.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef CONTROLLER_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define CONTROLLER_H</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;QString&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;variant.h&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;constants.h&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;request.h&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;cppwebframework_global.h&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;CWF_BEGIN_NAMESPACE</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">class </span><a class="code" href="class_request.html">Request</a>;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">class </span><a class="code" href="class_response.html">Response</a>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_controller.html">   28</a></span>&#160;<span class="keyword">class </span>CPPWEBFRAMEWORKSHARED_EXPORT <a class="code" href="class_controller.html">Controller</a></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keywordtype">void</span> doMessage(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp, QString method) <span class="keyword">const</span>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="class_controller.html#a867c1b386aa6e63d986a01ddaeccea5a">   41</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_controller.html#a867c1b386aa6e63d986a01ddaeccea5a">~Controller</a>() {}</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="class_controller.html#ab98176c753629fff6c8d36bbf28c16b9">   47</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#ab98176c753629fff6c8d36bbf28c16b9">doDelete</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::DELETE); }</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_controller.html#aa5d2ca4308e70c23d1d2b31f012b3f00">   53</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#aa5d2ca4308e70c23d1d2b31f012b3f00">doGet</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::GET); }</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_controller.html#a1cec4b14d083984b9f7acbdc20a8e474">   59</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#a1cec4b14d083984b9f7acbdc20a8e474">doOptions</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::OPTIONS); }</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_controller.html#a8de02c2d94545b67c6b2beb8ed28e8a2">   65</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#a8de02c2d94545b67c6b2beb8ed28e8a2">doPost</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::POST); }</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_controller.html#a444a462c40ee74f016959d1731264135">   71</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#a444a462c40ee74f016959d1731264135">doPut</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::PUT); }</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="class_controller.html#af33788f3aa0b3ee7300ab2f1b2f5f28d">   77</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_controller.html#af33788f3aa0b3ee7300ab2f1b2f5f28d">doTrace</a>(<a class="code" href="class_request.html">Request</a> &amp;req, <a class="code" href="class_response.html">Response</a> &amp;resp)<span class="keyword"> const </span>{ doMessage(req, resp, HTTP::METHOD::TRACE); }</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;};</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;CWF_END_NAMESPACE</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">#endif // CONTROLLER_H</span></div><div class="ttc" id="class_controller_html_a867c1b386aa6e63d986a01ddaeccea5a"><div class="ttname"><a href="class_controller.html#a867c1b386aa6e63d986a01ddaeccea5a">Controller::~Controller</a></div><div class="ttdeci">virtual ~Controller()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> controller.h:41</div></div>
<div class="ttc" id="class_controller_html_aa5d2ca4308e70c23d1d2b31f012b3f00"><div class="ttname"><a href="class_controller.html#aa5d2ca4308e70c23d1d2b31f012b3f00">Controller::doGet</a></div><div class="ttdeci">virtual void doGet(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the get request method. </div><div class="ttdef"><b>Definition:</b> controller.h:53</div></div>
<div class="ttc" id="class_controller_html_ab98176c753629fff6c8d36bbf28c16b9"><div class="ttname"><a href="class_controller.html#ab98176c753629fff6c8d36bbf28c16b9">Controller::doDelete</a></div><div class="ttdeci">virtual void doDelete(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the delete request method. </div><div class="ttdef"><b>Definition:</b> controller.h:47</div></div>
<div class="ttc" id="class_request_html"><div class="ttname"><a href="class_request.html">Request</a></div><div class="ttdoc">The Request class holds all information about a http request. </div><div class="ttdef"><b>Definition:</b> request.h:27</div></div>
<div class="ttc" id="class_controller_html_a1cec4b14d083984b9f7acbdc20a8e474"><div class="ttname"><a href="class_controller.html#a1cec4b14d083984b9f7acbdc20a8e474">Controller::doOptions</a></div><div class="ttdeci">virtual void doOptions(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the options request method. </div><div class="ttdef"><b>Definition:</b> controller.h:59</div></div>
<div class="ttc" id="class_controller_html"><div class="ttname"><a href="class_controller.html">Controller</a></div><div class="ttdoc">The Controller class is responsable to attend a request from a specific url. You will need to create ...</div><div class="ttdef"><b>Definition:</b> controller.h:28</div></div>
<div class="ttc" id="class_controller_html_a444a462c40ee74f016959d1731264135"><div class="ttname"><a href="class_controller.html#a444a462c40ee74f016959d1731264135">Controller::doPut</a></div><div class="ttdeci">virtual void doPut(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the put request method. </div><div class="ttdef"><b>Definition:</b> controller.h:71</div></div>
<div class="ttc" id="class_controller_html_af33788f3aa0b3ee7300ab2f1b2f5f28d"><div class="ttname"><a href="class_controller.html#af33788f3aa0b3ee7300ab2f1b2f5f28d">Controller::doTrace</a></div><div class="ttdeci">virtual void doTrace(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the trace request method. </div><div class="ttdef"><b>Definition:</b> controller.h:77</div></div>
<div class="ttc" id="class_response_html"><div class="ttname"><a href="class_response.html">Response</a></div><div class="ttdoc">The Response class is responsable to response a Http request. </div><div class="ttdef"><b>Definition:</b> response.h:25</div></div>
<div class="ttc" id="class_controller_html_a8de02c2d94545b67c6b2beb8ed28e8a2"><div class="ttname"><a href="class_controller.html#a8de02c2d94545b67c6b2beb8ed28e8a2">Controller::doPost</a></div><div class="ttdeci">virtual void doPost(Request &amp;req, Response &amp;resp) const</div><div class="ttdoc">This is an virtual method that can be overloaded to attend the post request method. </div><div class="ttdef"><b>Definition:</b> controller.h:65</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 28 2018 11:09:08 for C++ Web Framework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
